#!/bin/bash

IMAGE_NAME=${IMAGE_NAME:-ccr.ccs.tencentyun.com/q1tv/admin-web}
echo "IMAGE_NAME: ${IMAGE_NAME}"

IMAGE_TAG=${IMAGE_TAG:-latest}
echo "IMAGE_TAG: ${IMAGE_TAG}"

docker build -t $IMAGE_NAME:${IMAGE_TAG} -f ./docker/Dockerfile ./dist/

docker push ${IMAGE_NAME}:${IMAGE_TAG}
docker rmi ${IMAGE_NAME}:${IMAGE_TAG}